#include <zlog.h>
#include "log_intf.h"
#include "lvos.h"  // 包含标准类型定义

static zlog_category_t *log_category = NULL;

#ifdef LLT
#define LOG_CONF_PATH "../log.conf"
#else
#define LOG_CONF_PATH "./log.conf"
#endif

zlog_category_t *GetLogInsTance(void)
{
    return log_category;
}

int32_t log_init(void)
{
    if (zlog_init(LOG_CONF_PATH)) {
        printf("log_path is invalid\n");
        return RETURN_ERROR;
    }
    log_category = zlog_get_category("terminal");
    if (!log_category) {
        zlog_fini();
        printf("get log category failed\n");
        return RETURN_ERROR;
    }

    return RETURN_OK;
}

void log_deinit(void)
{
    if (log_category) {
        zlog_fini();
        log_category = NULL;
    }
}

int32_t add(int32_t a, int32_t b) {
    return a + b;
}
